<?php
/**
 * settings_list.inc
 * Template: List all ini files.
 * @copyright	Copyright(c) 2002-2010 Bjorn Winberg
 * @author		Bjorn Winberg <cms@anomalye.net>
 * @license		http://www.gnu.org/licenses/gpl.html GNU General Public License version 2
 * @package		AnomalyWiki
 */
?>
<h1><?php echo $this->localString('TL_TITLE');?></h1>



<div class='subMenu'>
<?php
	echo '<ul>';
	if(isset($aParams['fileList'])){
		foreach($aParams['fileList'] as $ini => $iniName){
			$iniName = $iniName != ''? $iniName: $ini;
			echo '<li>' . $this->generateLink('settings', $this->getSafeStr($iniName), array('module' => $ini)) . '</li>';
		}
	}
	echo '</ul>';
?>
</div>
<div class="helpBox">
	<?php echo $this->localString('TL_HELP');?>
</div>

<form class="simpleForm" id="settings_globalEditForm" action="<?php echo $this->generateUrl('settings', array('module' => $aParams['module'], 'a' => 'save'));?>" method='post'>
	<fieldset>
	<legend></legend>
	<?php
		echo $this->localString('TL_GLOBAL');
		if(isset($aParams['globalList']['settings'])){
			foreach($aParams['globalList']['settings'] as $key => $value){
				echo '<div class="simpleOptional"><label for="' . $key . '">' . $key . '</label><textarea type="text" name="' . $key . '">' . $this->getSafeStr($value) . '</textarea></div>';
			}
		}
		else{
			echo '<div>' . $this->localString('TL_NO_GLOBAL') . '</div>';
		}
		echo $this->localString('TL_LOCAL');
		if(isset($aParams['localList']['localized'])){
			foreach($aParams['localList']['localized'] as $key => $value){
				echo '<div class="simpleOptional"><label for="' . $key . '">' . $key . '</label><textarea type="text" name="' . $key . '">' . $this->getSafeStr($value) . '</textarea></div>';
			}
		}
		else{
			echo '<div>' . $this->localString('TL_NO_LOCAL') . '</div>';
		}
		echo '<input type="submit" name="submit" value="' . $this->localString('TL_SUBMIT') . '" />';
	?>
</fieldset>
</form>
